Skip to content

fix(mcp): make explore cross-context dedup opt-in - #1624

Open
danusha2345 wants to merge 2 commits into
colbymchenry:mainfrom
danusha2345:fix/1620-explore-context-dedup
Open

fix(mcp): make explore cross-context dedup opt-in#1624
danusha2345 wants to merge 2 commits into
colbymchenry:mainfrom
danusha2345:fix/1620-explore-context-dedup

Conversation

@danusha2345

Copy link
Copy Markdown
Contributor

Summary

Fixes #1620.

An MCP connection is not a reliable conversation boundary: hosts may reuse it for subagents or keep it alive across context compaction. Suppressing source by default can therefore point an agent at text that its current context never received.

  • default cross-call source deduplication to off
  • enable it only for explicit truthy CODEGRAPH_EXPLORE_DEDUP=1 style values
  • preserve the existing optimization for hosts that guarantee one durable agent context per connection
  • test both the safe default and explicit opt-in behavior

This is deliberately limited to the correctness fix and does not add installer hooks or host trust state.

Verification

  • npm run build:kernel
  • npm run build
  • focused dedup suite — 26 passed
  • npm test -- --reporter=dot — 194 files, 3231 passed, 10 skipped

@danusha2345
danusha2345 force-pushed the fix/1620-explore-context-dedup branch from d8e500b to 63992fa Compare August 28, 2026 07:03
@bompus

bompus commented Sep 5, 2026

Copy link
Copy Markdown

Verified on a real TypeScript repo (Chrome MV3 extension, 582 files, TS/JS/Vue/markdown, Windows 11, tree-sitter wasm walker, kernel off). Branch: this PR merged onto current main (b9ca4b7) plus our fork's markdown/literal extras; control build indexed the same tree without the PR.

Merges clean onto main. No index change (identical node/edge counts), as expected for an opt-in flag. PR test files: 26/26 pass.

Verified alongside #1621 on the same tree; that one has two Windows-only test failures (details there), this one none. Either fixes the subagent "already sent" case for us; this one does it without installing session hooks into user settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

codegraph_explore tells a fresh subagent that source was "already sent" to a different context

2 participants